//
//  KNPath.m
//  Teacher_ZXT
//
//  Created by knrainy on 15-1-20.
//  Copyright (c) 2015年 knrainy. All rights reserved.
//

#import "KNPath.h"

@implementation KNPath


/* ------------------  caches Path  ------------------ */
+ (NSString *)cachesPath
{
    NSString *caches = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    return caches;
}

/* ------------------  document Path  ------------------ */
+ (NSString *)documentPath
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docDir = [paths objectAtIndex:0];
    return docDir;
}

/* ------------------  contacts DB Path (联系人 DB)  ------------------ */
//联系人 数据库 文件夹路径
+ (NSString *)contactsDBFolderPath
{
    /**
     联系人 DB 暂时放在 document 文件夹中
     */
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docDir = [paths objectAtIndex:0];
    return docDir;
}
//联系人 数据库 文件路径
+ (NSString *)contactsDBFilePath
{
    return [[KNPath contactsDBFolderPath] stringByAppendingPathComponent:@"ContactsDao.db"];
}
//消息 数据库 文件路径
+ (NSString *)messageDBFilePath
{
    return [[KNPath contactsDBFolderPath] stringByAppendingPathComponent:@"MessageDao.db"];
}
// NSTemporaryDirectory();
// NSString *homeDir = NSHomeDirectory()


/**
 NSString *imagePath = [[NSBundle mainBundle] pathForResource:@”apple” ofType:@”png”];
 UIImage *appleImage = [[UIImage alloc] initWithContentsOfFile:imagePath];
 */
@end
